/*
 *  SMImage.h
 *  Seams
 *
 *  Created by Charles Osmer on 4/10/09.
 *  Copyright 2009 __MyCompanyName__. All rights reserved.
 *
 */

typedef int SMPlaneType;
typedef SMPlaneType** SMImagePlane;

#define GRAY    0
#define R       0
#define G       1
#define B       2
#define RGB     3

typedef struct {

    SMImagePlane planes[3];
    int nPlanes;

    int width;
    int height;

} SMImage;

#define SMImageAssert(im) {assert(im != NULL); assert(im->nPlanes > 0);};

extern const SMImage SMImage_Initializer;

void SMImage_Alloc(SMImage *image, const int nPlanes, const int width, const int height);
void SMImage_Free(SMImage *image);
void SMImage_Copy(SMImage *copy, const SMImage *original);

SMImage SMImage_RGB2Gray(const SMImage *image);

void SMImage_Normalize(const SMImage *image, unsigned int high);

SMImage SMImage_SobelEdges(const SMImage *image);

#if 0
SMImage SMImage_Laplacian(const SMImage *image);
SMImage SMImage_PoissionReconstruction(const SMImage *image, const SMImage *laplacian);
#endif
